import java.util.Scanner;

public class Dabaicai {
    public static void main(String[] args) {
        int[] arr = new int[6];
        Scanner as = new Scanner(System.in);
        System.out.println("请打出六位评委的分数:");
        for (int i = 0; i < arr.length; i++) {
            System.out.println("请您数第" + (i + 1) + "个评委的打分");
            int score = as.nextInt();
            if (score > 0 && score <= 100) {
                arr[i] = score;
            } else {
                System.out.println("您输入的数值不合法");
                i--;  //点睛之笔妙啊！！！！
            }
        }
        int max = arr[0];
        for (int i = 0; i < arr.length; i++) {
            if (max < arr[i]) {
                max = arr[i];
            }
        }
        int min = arr[0];
        for (int i = 0; i < arr.length; i++) {
            if (min > arr[i]) {
                min = arr[i];
            }
        }
        int allin = 0;
        for (int i = 0; i < arr.length; i++) {
            allin += arr[i];
        }
        System.out.println("总评分和"+allin);
        int avg;
        avg = (allin - min - max) / 4;
        System.out.println("平均值"+avg);
    }
}
